package ltd.dujiabao.capability.domain.capmng.sync;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import ltd.dujiabao.capability.domain.devmng.DevType;

/**
 * @author : DuJiabao
 * @Project : ddd-capability
 * @Time : 2024/4/8 23:18
 * @Desc :
 */
@Component
public class SynchronizerBuilderFactory {
    @Autowired
    private WorkerRepository workerRepository;

    public SynchronizerBuilder createBuilder(DevType devType) {
        List<Worker> workers = workerRepository.findWorkers(devType);
        return new SynchronizerBuilder(devType, workers);
    }
}
